<template>
  <div id="orderDetail">
    <div @click="back"><i class="el-icon-arrow-left"></i>返回</div>
    <div>订单编号：{{ orderId }}</div>
    <div>下单时间：{{ orderTime }}</div>
    <div>订单状态：{{ status }}</div>
    <div>员工编号：{{ waiterId }}</div>
    <div>顾客：{{ customer }}</div>
    <div>顾客手机号：{{ telephone }}</div>
  </div>
</template>
<script>
export default {
  created() {
    this.id = this.$route.query.id;
  },
  mounted() {
    // console.log(this.id);
    var id = this.id;
    var self = this;
    this.$axios.get("/order/findById", { params: { id } }).then((res) => {
      console.log(res.data.data);
      this.orderId = res.data.data.id;
      this.orderTime = res.data.data.orderTime;
      this.status = res.data.data.status;
      this.waiterId = res.data.data.waiterId;
      this.customer = res.data.data.customer.realname;
      this.telephone = res.data.data.customer.telephone;
    });
  },
  data() {
    return {
      id: 1,
      orderId: 1,
      orderTime: "",
      status: "",
      waiterId: "",
      customer: "",
      telephone: "",
    };
  },
  methods: {
    back() {
      this.$router.back();
    },
  },
};
</script>
<style lang="less" scoped>
#orderDetail {
  & > div {
    margin: 20px;
  }
  & > div:first-child {
    font-size: 15px;
    color: skyblue;
  }
  & > div:first-child:hover {
    cursor: pointer;
  }
}
</style>